<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="node_modules/_vue@2.5.17@vue/dist/vue.min.js"></script>
</head>
<body>
<div id="app">
    <input type="button" value="动起来" @click='lang'>
    <input type="button" value="停止" @click='stop'>
    <p>{{info}}</p>
</div>

<script>
    let vm = new Vue({
        el:'#app',
        data:{
            info:'猥琐发育，别浪！！！',
            unstop : null,
        },
        methods:{
            lang(){
                if (this.unstop != null) return;
               this.unstop = setInterval(() =>{
                    let start = this.info.substring(0, 1)
                   // 获取到 后面的所有字符
                    let end = this.info.substring(1)
                   // 重新拼接得到新的字符串，并赋值给 this.msg
                   this.info = end + start
               },400)
            },
            stop(){
                clearInterval(this.unstop);
                this.unstop =null;
            }
        }
    })
</script>
</body>
</html>